<%-- 
    Document   : login
    Created on : Jun 13, 2011, 7:07:23 AM
    Author     : Giang Nguyen
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="common.Constant" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="<%=Constant.CONTEXT_PATH%>/style.css" />
        <!--[if IE 6]><link rel="stylesheet" type="text/css" href="<%=Constant.CONTEXT_PATH%>/iecss.css" /><![endif]-->
        <script type="text/javascript" src="js/boxOver.js"></script>
        <title>Login Page</title>
    </head>
    <body>
        <div id="main_container">
            <!-- S HEAD CONTENT -->
            <jsp:include page="block/header.jsp" />
            <!-- E HEAD CONTENT -->

            <!-- S Top Menu -->
            <jsp:include page="block/top_menu.jsp" />
            <!-- E Top Menu -->

            <!-- S Navigation -->
            <jsp:include page="block/navigation.jsp" />
            <!-- E Navigation -->

            <!-- S Left Menu -->
            <jsp:include page="block/left_menu.jsp" />
            <!-- E Left Menu -->

            <!-- S Body Content -->
            <div class="center_content">
                <p>
                    <c:if test="${not empty param.err}">
                          ${param.err}
                    </c:if>
                </p>
                <form id="frmLogin" action="<%=Constant.CONTEXT_PATH%>/LoginController.do" method="post">
                    <c:if test="${not empty param.target}">
                        <input type="hidden" name="hiddenTarget" id="hiddenTarget" value="${param.target}"/>
                    </c:if>
                    <table cellspacing="5" cellpadding="5" border="0">
                        <tr>
                            <td colspan="2" align="left"><h3>Login</h3><hr></td>
                        </tr>
                        <tr>
                            <td>Username:&nbsp;</td>
                            <td><input name="txtUsername" type="text"/></td>
                        </tr>
                        <tr>
                            <td>Password:&nbsp;</td>
                            <td><input name="txtPassword" type="password"/></td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right">
                                <input type="submit" name="btnLogin" value="Login"/>
                                <input type="reset" name="btnReset" value="Reset"/>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
            <!-- E Body Content -->

            <!-- S Right Menu -->
            <jsp:include page="block/right_menu.jsp" />
            <!-- E Right Menu -->

            <!-- S Footer -->
            <jsp:include page="block/footer.jsp" />
            <!-- E Footer -->
        </div>
    </body>
</html>
<script type="text/javascript" >
    $(function() {
        $.getScript("<%= Constant.CONTEXT_PATH + "/js/jquery.validate.js"%>", function () {
            $('#frmLogin').validate({
                errorClass: "invalid",
                rules: {
                    txtUsername: {required: true, rangelength: [6, 20]},
                    txtPassword: {required: true, rangelength: [6, 20]}
                },
                messages: {
                    txtUsername: {required: ""},
                    txtPassword: {required: ""}
                }
            })
        });
    });
</script>